
import ObjectManager.ObjectGame;
import javax.microedition.lcdui.*;
import javax.microedition.lcdui.game.*;

public class Map extends ObjectGame{
    
    Sprite carSprite;
    
    public Map(String imgSrc, int width, int height) {
        super(imgSrc, width, height);
        
        try{
            Image img = Image.createImage("/Images/MiniRedCar.PNG");
            carSprite = new Sprite(img, 10, 21);
        }
        catch(Exception ex){}
    }
    
    public void SetCurrentPos(int x, int y){
        this.currentX = x;
        this.currentY = y;
        objSprite.setPosition(x, y);
        carSprite.setPosition(x, y + height - 21);
    }
    
    public void SetMiniCarCurrentY(int y){
        carSprite.setPosition(carSprite.getX(), y);            
    }
}
